#ifndef AED_ALWAYSCOMP_H
#define AED_ALWAYSCOMP_H

#include <QString>
#include <QList>
#include <QTextStream>
#include <QDomDocument>

using namespace std;


class AED_AlwaysComp
{
public:
    struct Condition{
        QString name;
        int omega;
        bool inv;

        Condition(const QString &n, int o, bool i):name(n),omega(o),inv(i){}
        Condition(const Condition &cond){name = cond.name;  omega = cond.omega; inv = cond.inv;}
        //Condition& operator=(const Condition &cond){name = cond.name;  omega = cond.omega; inv = cond.inv; return *this;}
        bool operator==(const Condition &cond){if(name==cond.name && omega == cond.omega && inv == cond.inv) return true; return false;}
    };
private:
    QList<Condition> m_conds;
    bool m_enabled;

public:
    AED_AlwaysComp();
    AED_AlwaysComp& operator =(const AED_AlwaysComp &comp);

    void AddCondition(const QString &name, int omega, bool inv);
    void RemoveCondition(int index);
    QList<Condition>* GetConditionList();

    bool IsEnabled();
    void SetEnabled(bool enabled);

    void Save(QTextStream &file);
    void Save(QDomDocument &doc, QDomElement &pelem);

    void Load(QDomElement &celem);

};

#endif // AED_ALWAYSCOMP_H
